package org.javahispano.javacup.tacticas_aceptadas.jpautom.org.javahispano.javacup.tacticas.pitufos;
import java.awt.geom.*;

public class Pos extends Point2D.Double {
	public double z;
	public Pos() {}
	public Pos(Pos p) {
		setLocation(p.x, p.y, p.z);
	}

	public Pos(double x, double y, double z) {
		setLocation(x, y, z);
	}

	public void set(Pos p) {
		setLocation(p.x, p.y, p.z);
	}
	
	public void setLocation(double x, double y, double z) {
		setLocation(x, y);
		this.z=z;
	}

	public double distance(Pos p) {
		return Math.sqrt(distanceSq(p));
	}

	public double distanceSq(Pos p) {
		return (p.x-x)*(p.x-x)+(p.y-y)*(p.y-y)+(p.z-z)*(p.z-z);
	}

	public double distance2d(Pos p) {
		return super.distance(p);
	}

	public double distance2d(double x, double y) {
		return super.distance(x, y);
	}

	public double distance2dSq(Pos p) {
		return super.distanceSq(p);
	}

	public double distance2dSq(double x, double y) {
		return super.distanceSq(x, y);
	}


	public double getZ() {
		return z;
	}

	@Override
	public String toString() {
		return "Pos["+x+", "+y+", "+z+"]";
	}
}
